<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>2.模拟一个数据劫持</title>
	</head>
	<body>
		<h1>当前的数字是：1</h1>
		<script type="text/javascript" >
			let _data = {}

			Object.defineProperty(_data,'a',{
				get:function reactiveGetter(){
					return 1
				},
				set:function reactiveSetter(value){
					console.log('a被修改了，并且值为：',value,'我要拿着a的值去更新页面了')
				}
			})

		</script>
	</body>
</html>